<%-- 
    Document   : settings
    Created on : 4-Feb-2014, 10:08:09 AM
    Author     : anvil
--%>

<%@page import="DatabaseConn.SQLBroker"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>

        <!-- Latest compiled and minified CSS -->
        <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">

        <!-- Optional theme -->
        <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css">

        <!-- Latest compiled and minified JavaScript -->
        <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>AnvilWeb Settings</title>
    </head>
    <body>
        <!--Start of NavBar-->
        <div class="navbar navbar-inverse">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-inverse-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
            </div>
            <div class="navbar-collapse collapse navbar-inverse-collapse">
                <a class="navbar-brand pull-right">AnvilWeb</a>

                <ul class="nav navbar-nav">
                    <li><a href="home.jsp">Home</a></li>
                    <li><a href="employee.jsp">Employee</a></li>
                    <li><a href="reports.jsp">Reports</a></li>
                    <li class="active"><a href="settings.jsp">Settings</a></li>
                    <li><a href="index.jsp">Logout</a></li>
                </ul>
            </div>
        </div>
        <!--End of NavBar-->

    <legend><h1 class="text-primary">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>Connection Settings</b></h1></legend>
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <a class="list-group-item">
                <center>
                    <legend>SQL Database Connection</legend>
                    <p class="list-group-item-text">
                    <form action="SQLHelper" method="GET">
                        File Path & IP Address:
                        <input type="text" name="ipadd"><br/>
                        Database Username:
                        <input type="text" name="username"><br/>
                        Database Password:
                        <input type="password" name="password"><br/><br/>
                        <table>
                            <tr><td>
                                    <input type="submit" class="btn btn-default" value="Test Connection"><br/></td>
                                <td><input type="submit" name="connect" class="btn btn-default" value="Connect to Database"></td></tr>
                        </table>
                    </form>

                    <label class="text-warning">
                        <%=(request.getParameter("message") != null) ? request.getParameter("message") : ""%>
                    </label>
                </center>
                </p>
            </a>
        </div>
        <div class="col-md-3"></div>
    </div>
    <br/><br/>
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <a class="list-group-item">
                <center>
                    <legend>LDAP Directory Connection</legend>
                    <table>
                        <form action="LDAPConnection" method="GET">
                            <tr><td>LDAP URL:</td>
                                <td><input type="text" name="url"></td></tr>
                            <tr><td>Port:</td>
                                <td><input type="text" value="0000" name="port"></td></tr>
                            <tr><td>BaseDN:</td>
                                <td><input type="text" name="basedn"></td></tr>
                            <tr><td><br/></td></tr>
                            <tr><td><input type="submit" onclick="form.action = 'TestConnection';" class="btn btn-default" value="Test Connection"></td>

                                <td><input type="submit" name="connect" class="btn btn-default" value="Connect to Directory"></td></tr>
                        </form>
                    </table>
                    </br>
                    <%=(request.getParameter("ldapmessage") != null) ? request.getParameter("ldapmessage") : ""%>
                </center>
            </a>

        </div>
        <div class="col-md-3"></div>
    </div>

</body>
</html>
